package secondStage.part2.多态.one;

/**
 * @ClassName: [AnimalOperator]
 * @Description: 动物操作类
 * @Author: [黄劲松]
 * @CreateDate: [2021-03-14]
 * @Version: [v1.0]
 */
public class AnimalOperator {
    /*public void useAnimal(Cat cat){//Cat cat = new Cat();
        cat.eat();
    }
    public void useAnimal(Dog dog){//Dog dog = new Dog();
        dog.eat();
    }*/
    //以上方法可以用下面方法代替
    public void useAnimal(Animal a) {
        a.eat();
//        a.lookDoor();//多态的弊端：不能访问子类特有的功能
    }
}
